import abc
from enum import Enum

## 定义符号
class Symbol(metaclass=abc.ABCMeta):
    ## 符号优先级，数值越大优先级越高
    _priority = 0

    ## 构造函数
    def __init__(self, priotiry):
        self._priority = priotiry

    def getPriority(self):
        return self._priority

    ## 抽象方法，返回当前符号类型
    @abc.abstractclassmethod
    def getType(self):
        pass

    ## 抽象方法，返回当前符号值
    @abc.abstractclassmethod
    def getValue(self):
        pass

    def isNumber(self):
        return self.getType() is SymbolType.NUMBER

    def isOperator(self):
        return self.getType() is SymbolType.OPERATOR

  

## 符号类型枚举
class SymbolType(Enum):
    NUMBER = 1
    OPERATOR = 2